package com.cy.health.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
public class TemplateController {
    /**
     * http://localhost/doTemplateUI/
     * @return
     */
    @RequestMapping("/doTemplateUI")
    public String doTemplateUI(Model model, HttpServletRequest request) {// DispatcherServlet调用方法
        String username = request.getParameter("username");
        System.out.println(username);
        model.addAttribute("name", "Default");
        return "default";// ViewResolver
        /*
         *  添加前缀和后缀(例如/templates/default.html)
         * 对html页面中的元素进行解析(对特定属性进行解析)
         */
    }
}
